package com.zhang.authoritycenter.common.config;

import com.zhang.authoritycenter.common.properties.ObsClientProperties;
import com.obs.services.ObsClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor;

import javax.annotation.Resource;

/**
 * description
 *
 * @author zhangFanJun
 * @date 2023-12-27 15:39
 **/
@Configuration
public class BaseConfig {

    @Resource
    private ObsClientProperties obsClientProperties;

    @Bean(name = "obsClient")
    public ObsClient obsClientSource() {
        return new ObsClient(obsClientProperties.getAccessKey(), obsClientProperties.getSecrtKey(), obsClientProperties.getConf());
    }

    @Bean
    public MethodValidationPostProcessor methodValidationPostProcessor() {
        return new MethodValidationPostProcessor();
    }
}
